﻿@using TinyMoocSite.ViewModels
@model CourseList
    
@{
    ViewBag.Title = "Tiny MOOC";
    Layout = "~/Views/Shared/DefaultLayout.cshtml";
}

@section FullContainer
{
    <div class="col-sm-3">
        <div class="list-group" style="margin:20px 0px 0px 0px">
            <a href="/Student/Index?Type=Current" class="list-group-item @ViewData["Current"]">正在学习的课程</a>
            <a href="/Student/Index?Type=Opening" class="list-group-item @ViewData["Opening"]">开放的所有课程</a>
            <a href="/Student/Index?Type=Previous" class="list-group-item @ViewData["Previous"]">完成学习的课程</a>
        </div>
    </div>

    <div class="col-sm-9">
        @if (Model.CourseItems.Count == 0)
        {
            <h3>暂时没有符合要求的课程。</h3>
        }

        @foreach (CourseShortItem item in Model.CourseItems)
        {
            <h3>@item.CourseTitle</h3>
            <p>
                <span class="glyphicon glyphicon-user" aria-hidden="true"></span> @item.Teachers &nbsp;&nbsp;
                <span class="glyphicon glyphicon-time" aria-hidden="true"></span> @item.StartTime --- @item.EndTime
            </p>

            <p>
                @Html.Raw(@item.Description)
            </p>
            
            if (item.Picked)
            {
                <p>
                    <a class="btn btn-default" href="/Student/Overview?Id=@item.CourseId"
                       role="button">进入该课程 &raquo;</a>
                </p>
            }
            else
            {
                <p>
                    <a class="btn btn-success" href="/Student/RegisterCourse?Id=@item.CourseId"
                       role="button">注册并进入该课程 &raquo;</a>
                </p>
            }

            <hr />
        }

    </div>
}
